
def split(locations):
	if not locations: return []

	def getDelta(loc1, loc2):
		return (loc1.updated - loc2.updated).seconds
	
	def getAverageDelta():
		deltaSum = 0.0
		for i in xrange(len(locations) - 1):
			deltaSum += getDelta(locations[i], locations[i+1])
		return deltaSum / (len(locations) - 1)
		
		
	avgDelta = getAverageDelta()
		
	res = []
	currentRoute = [locations[0]]
	for i in xrange(1, len(locations)):
		if getDelta(currentRoute[-1], locations[i]) <= avgDelta:
			currentRoute.append(locations[i])
		else:
			res.append(currentRoute)
			currentRoute = [locations[i]]
	
	res.append(currentRoute)
	
	return res
	